<html lang="en">
<head>
</head>
<body>
<div id="dom">1</div>
<script>
    'use strict';
    let val;
    document.getElementById('dom').addEventListener('click',en=>{
        getFirstChild(en.target)
    });
    function getFirstChild(target) {
        let {y,x}=target.getBoundingClientRect();
        return (val === 2)||!!(y&&x);
    }
    function init(va){
        val=va
    }
    init('2');
    console.log(val);
</script>
</body>
</html>


